// ADKDlg.h : header file
//

#pragma once
#include "afxcmn.h"
#include "Utility.h"

// CADKDlg dialog
class CADKDlg : public CDialog
{
	// Construction
public:
	CADKDlg(CWnd* pParent = NULL);	// standard constructor

	// Dialog Data
	enum { IDD = IDD_ADK_DIALOG };

	CString GetCurrentDir() const { return m_strAppPath;}

	HKEY m_hRootKey;
	HKEY m_hClassKey;
	HKEY m_hServiceKey;

protected:
	virtual void DoDataExchange(CDataExchange* pDX);	// DDX/DDV support


	// Implementation
protected:
	HICON m_hIcon;

	// Generated message map functions
	virtual BOOL OnInitDialog();
	afx_msg void OnPaint();
	afx_msg HCURSOR OnQueryDragIcon();
	afx_msg void OnBnClickedBtnExit();
	afx_msg void OnBnClickedBtnNew();
	afx_msg void OnBnClickedBtnRemove();
	afx_msg void OnBnClickedBtnHealth();
	afx_msg void OnSelDevChanged(NMHDR* pNMHDR, LRESULT* pResult);
	afx_msg LRESULT OnUpdateAllDevsInfo(WPARAM wParam, LPARAM lParam);
	afx_msg void OnBnClickedBtnModify();
	DECLARE_MESSAGE_MAP()

private:
	int GetAppPath();
	int QueryAllDevsNames();
	int QueryDeviceName(const CString& strDeviceClass);
	int AddNewLDN();
	int AddBasicInfo(const CString& strDefFile);
	int AddDeviceSetting(const DeviceDefinition &devDef);
	int AddProDefinition(const CString& strDevFile);
	void UpdateSelectedDeviceInfo();
	enum EDevInfo
	{
		EDEV_SUCCESS,
		EDEV_FAILED,
		EDEV_VENDOR,
		EDEV_COUNT
	};
	EDevInfo CheckDeviceVendorInfo(CString &strVendorInfo);

private:
	CString m_strAppPath;
	CTreeCtrl m_treeDevices;
	CString m_strCurDeviceName;
	CString m_strCurDeviceClass;
	CString m_strCurLDN;	
};
